package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysYongyouCprkMapper;
import com.ruoyi.system.domain.SysYongyouCprk;
import com.ruoyi.system.service.ISysYongyouCprkService;

/**
 * 产品入库Service业务层处理
 * 
 * @author SYF
 * @date 2025-04-18
 */
@Service
public class SysYongyouCprkServiceImpl implements ISysYongyouCprkService 
{
    @Autowired
    private SysYongyouCprkMapper sysYongyouCprkMapper;

    /**
     * 查询产品入库
     * 
     * @param vouchdate 产品入库主键
     * @return 产品入库
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public SysYongyouCprk selectSysYongyouCprkByVouchdate(String vouchdate)
    {
        return sysYongyouCprkMapper.selectSysYongyouCprkByVouchdate(vouchdate);
    }

    /**
     * 查询产品入库列表
     * 
     * @param sysYongyouCprk 产品入库
     * @return 产品入库
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public List<SysYongyouCprk> selectSysYongyouCprkList(SysYongyouCprk sysYongyouCprk)
    {
        return sysYongyouCprkMapper.selectSysYongyouCprkList(sysYongyouCprk);
    }

    /**
     * 新增产品入库
     * 
     * @param sysYongyouCprk 产品入库
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int insertSysYongyouCprk(SysYongyouCprk sysYongyouCprk)
    {
        return sysYongyouCprkMapper.insertSysYongyouCprk(sysYongyouCprk);
    }

    /**
     * 修改产品入库
     * 
     * @param sysYongyouCprk 产品入库
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int updateSysYongyouCprk(SysYongyouCprk sysYongyouCprk)
    {
        return sysYongyouCprkMapper.updateSysYongyouCprk(sysYongyouCprk);
    }

    /**
     * 批量删除产品入库
     * 
     * @param vouchdates 需要删除的产品入库主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteSysYongyouCprkByVouchdates(String[] vouchdates)
    {
        return sysYongyouCprkMapper.deleteSysYongyouCprkByVouchdates(vouchdates);
    }

    /**
     * 删除产品入库信息
     * 
     * @param vouchdate 产品入库主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteSysYongyouCprkByVouchdate(String vouchdate)
    {
        return sysYongyouCprkMapper.deleteSysYongyouCprkByVouchdate(vouchdate);
    }

    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteByDateRange(String startDate)
    {
        return sysYongyouCprkMapper.deleteByDateRange(startDate);
    }
}
